import screenfull from 'screenfull'

export default class DeviceUtil {

    /**
     * 全屏切换
     */
    static fullScreen() {
        if (screenfull.isEnabled) {
            screenfull.toggle()
            return screenfull.isFullscreen
        }
        return null
    }

    /**
     * 获取当前是否是全屏状态
     */
    static getFullScreenStatus() {
        return screenfull.isFullscreen
    }

    /**
        设置body边距，解决弹框存在白边
     */
    static setBoay(){
        setTimeout(() => {
            let bodyT:any = document.querySelector("body")
            bodyT.setAttribute('style', 'padding: 0px;')
        }, 10);
    }

}